<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">

<link  rel="stylesheet" href="__static__/pinglun/css/main.css" />
<link rel="stylesheet" type="text/css" href="__static__/pinglun/css/sinaFaceAndEffec.css" />

<script type="text/javascript" src="__static__/pinglun/js/jquery-1.8.3.min.js"></script>

<title>贵州文化历史网</title>
</head>
<body>
    <div id="content" style="width: 700px; height: auto;margin-left:10px;margin-top:40px">
        <div class="wrap">
            <div class="comment">
                <div class="head-face">
                    <img src="__static__/pinglun/images/1.jpg" />
                    <p>我是鸟</p>
                </div>
                <div class="content">
                    <div class="cont-box">
                        <textarea class="text" id="mess" name="mess" placeholder="请输入..."></textarea>
                    </div>
                    <div class="tools-box">
                        <div class="operator-box-btn"><span class="face-icon">☺</span><span class="img-icon">▧</span></div>
                        <div class="submit-btn"><input type="submit" onclick="ti({$Request.session.userid})" value="提交评论" /></div>
                    </div>
                </div>
            </div>
            <div id="info-show">
                <ul>
                    {volist name="mess_user" id="mess_user"}
                    <li>
                        <div class="head-face">
                            <img src="__static__/pinglun/images/1.jpg" / >
                        </div>
                        <div class="reply-cont">
                            <p class="username">{$mess_user.name}</p>
                            <p class="comment-body">{$mess_user.content}</p>
                            <p class="comment-footer">{$mess_user.create_time}　回复　点赞54　转发12</p>
                        </div>
                    </li>
                    {/volist}
                </ul>
            </div>
        </div>
    </div>
    
    <script type="text/javascript" src="__static__/pinglun/js/main.js"></script>
    <script type="text/javascript" src="__static__/pinglun/js/sinaFaceAndEffec.js"></script>
    <script type="text/javascript">
        function ti(uid) {
            // layer.msg('1');
            var id = uid;
            var mess = $("#mess").val();
            var artresid = {$mess_user.id};
            $.ajax({
                type: 'post',
                url: "{:url('index/messages/add')}",
                data: { id: id, content: mess, artresid: artresid },
                dataType: 'json',
                success: function (res) {
                    if (res.code == 1) {
                        layer.msg(res.msg, { icon: 1, time: 1000 });
                        setTimeout(function () {
                            window.location.reload()
                        }, 1000)
                    } else if(res.code = 2){
                        layer.msg(res.msg , { icon: 5, time: 1000 });
                        setTimeout(function () {
                            window.location.href="{:url('index/admin/login')}";
                        }, 1000)
                    }
    
                },
                error: function (res) {
                    console.log(res.msg);
                },
            });
        }
    </script>
    <script type="text/javascript">
        // 绑定表情
        $('.face-icon').SinaEmotion($('.text'));
        // 测试本地解析
        function out() {
            var inputText = $('.text').val();
            $('#info-show ul').append(reply(AnalyticEmotion(inputText)));
        }
        
        var html;
        function reply(content){
            html  = '<li>';
            html += '<div class="head-face">';
            html += '<img src="__static__/pinglun/images/1.jpg" / >';
            html += '</div>';
            html += '<div class="reply-cont">';
            html += '<p class="username">小小红色飞机</p>';
            html += '<p class="comment-body">'+content+'</p>';
            html += '<p class="comment-footer">2016年10月5日　回复　点赞54　转发12</p>';
            html += '</div>';
            html += '</li>';
            return html;
        }
    </script> -->
     </body>
    </html>